﻿using EasyNetQ;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace WebAppEasynetQ.Controllers
{
    public class ValuesController : ControllerBase
    {
        private IBus _bus;
        public ValuesController(IBus bus)
        {
            _bus = bus;
        }


        // POST api/values
        [HttpPost]
        public async Task Post([FromBody] Order message)
        {
            await _bus.PubSub.PublishAsync<Order>(message);
        }
    }
}
